package com.comecrd.service;

import com.comecrd.model.CheckIn;
import com.comecrd.model.dto.CheckInDTO;

import java.util.List;
import java.util.Map;

public interface CheckInService {
    
    // 保存打卡记录
    CheckIn saveCheckIn(CheckIn checkIn);
    
    // 根据ID查找打卡记录，返回DTO对象
    CheckInDTO findById(Long id, Long currentUserId);
    
    // 根据用户ID查找打卡记录列表，返回DTO对象列表
    List<CheckInDTO> findByUserId(Long userId, Long currentUserId, int page, int size);
    
    // 查找所有打卡记录，返回DTO对象列表
    List<CheckInDTO> findAll(Long currentUserId, int page, int size);
    
    // 删除打卡记录
    void deleteById(Long id);
    
    // 转换CheckIn实体为CheckInDTO
    CheckInDTO convertToDTO(CheckIn checkIn, Long currentUserId);
    
    // 批量转换CheckIn实体为CheckInDTO
    List<CheckInDTO> convertToDTOList(List<CheckIn> checkIns, Long currentUserId);
    
    // 获取用户统计信息
    UserStats getUserStats(Long userId);
    
    // 切换点赞状态
    Map<String, Object> toggleLike(Long checkInId, Long userId);
    
    // 用户统计信息类
    class UserStats {
        private int checkInCount;
        private int likeCount;
        private int commentCount;
        
        // 构造函数、getter和setter
        public UserStats(int checkInCount, int likeCount, int commentCount) {
            this.checkInCount = checkInCount;
            this.likeCount = likeCount;
            this.commentCount = commentCount;
        }
        
        public int getCheckInCount() {
            return checkInCount;
        }
        
        public void setCheckInCount(int checkInCount) {
            this.checkInCount = checkInCount;
        }
        
        public int getLikeCount() {
            return likeCount;
        }
        
        public void setLikeCount(int likeCount) {
            this.likeCount = likeCount;
        }
        
        public int getCommentCount() {
            return commentCount;
        }
        
        public void setCommentCount(int commentCount) {
            this.commentCount = commentCount;
        }
    }
}